# -*- coding: utf-8 -*-
import requests

from urllib import parse


# url = "https://image.sogou.com/pics?query=%D1%E6%C1%E9%BC%A7&w=05009900&p=&_asf=pic.sogou.com&_ast=1600353186&sc=index&ie=gbk&sut=66619&sst0=1600353186256"

url = "https://i02piccdn.sogoucdn.com/06eb318085da0d01"

headers = {"User-Agent":
               "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36"}

# print(parse.unquote(url, encoding='gbk'))  # 解码url

resp = requests.get(url, headers=headers)

# print(resp.content.decode())

if resp.status_code == 200:
    with open("焰灵姬.jpg", 'wb') as f:
        f.write(resp.content)